[id].vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <div>
  3. <!-- 页面头部 -->
  4. <!-- <HomePageHead></HomePageHead> -->
  5. <AdvertisingHead></AdvertisingHead>
  6. <!-- 商圈详情 -->
  7. <div class="topicInfoBox">
  8. {{ dataInfo }}
  9. </div>
  10. <!-- 页面底部 -->
  11. <!-- <HomeFoot></HomeFoot> -->
  12. <AdvertisingFoot></AdvertisingFoot>
  13. </div>
  14. </template>
  15. <script setup>
  16. //1.引用模块 start ---------------------------------------->
  17. //使用ref和reactive动态变量
  18. import { ref, reactive, onMounted } from 'vue'
  19. import { useRoute } from 'vue-router';
  20. //使用官方ssr请求模块
  21. import { useNuxtApp, useFetch } from '#app'
  22. //使用element-plus组件
  23. import { ElTabs, ElTabPane, ElTable, ElTableColumn, ElPagination } from 'element-plus';
  24. import request from '@/api/api';
  25. //1.引用模块 end ---------------------------------------->
  26. //2.页面数据 start ---------------------------------------->
  27. const dataInfo = ref({})
  28. //2.页面数据 end ---------------------------------------->
  29. //2.获取商圈详情 start ---------------------------------------->
  30. const route = useRoute();
  31. const id = route.params.id; // 获取传递的 id 参数
  32. const getTopicInfo = () => {
  33. request('chat/getTopicInfo', { id: id }).then(res => {
  34. dataInfo.value = res._rawValue.data.data;
  35. })
  36. }
  37. getTopicInfo();
  38. console.log(dataInfo)
  39. //2.获取商圈详情 end ---------------------------------------->
  40. </script>
  41. <style lang="less" scoped>
  42. .topicInfoBox {
  43. width: 1200px;
  44. margin: 0 auto;
  45. padding: 20px 0;
  46. }
  47. </style>